<template>
    <div>
      <van-nav-bar
        title="地址信息"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
      />
      <van-address-edit
        :area-list="areaList"
        show-set-default
        show-search-result
        :area-columns-placeholder="['请选择省', '请选择市', '请选择区']"
        @save="onSave"
      />
    </div>
</template>
<script lang="ts">
  import { defineComponent } from 'vue';
import router from '@/router';
  export default defineComponent({
    name:'Address'
  })
</script>
<script lang="ts" setup>
import {areaList} from '@vant/area-data'
    const onSave = (SaveFrom:any) => {
      console.log(SaveFrom)
     const {name,isDefault,tel,addressDetail,areaCode} = SaveFrom
      router.push({
        path: '/ordergoods',
        query:{
          name:name,
          isDefault:isDefault,
          tel:tel,
          address:addressDetail,
          areaCode:areaCode
        }
      })
    }


    const onClickLeft = () => history.back();
</script>

<style lang="less" scoped>
</style>
